const p = {
    firstName: 'Lei',
    lastName: 'Wang',
    get fullName() {
        return this.firstName + " " + this.lastName
    }
}

console.log(p.fullName) // Lei Wang
let p2 = {}
Object.assign(p2, p)
console.log(p2) // { firstName: 'Lei', lastName: 'Wang', fullName: 'Lei Wang' }

const descriptor = Object.getOwnPropertyDescriptors(p)
console.log(descriptor)
const copyP = Object.defineProperties({}, descriptor)
console.log(copyP)  // { firstName: 'Lei', lastName: 'Wang', fullName: [Getter] }
copyP.firstName = 'qiuqiu'
console.log(copyP.fullName)



